<!DOCTYPE html>
<html>
<head>
<base href="."><title>BetWin</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale = 1.0; width = device-width;"/>

<meta name="viewport" content="width=device-width,maximum-scale=1"/>

<meta name="format-detection" content="telephone=no"/>
<link rel="stylesheet" type="text/css" href="./resources/css/android.css">
<link rel="stylesheet" type="text/css" href="./resources/css/sencha-touch.css">


<script type="text/javascript" language="javascript" src="sencha-touch-debug.js"></script>
<script type="text/javascript" language="javascript" src="sencha-touch-all-debug.js"></script>

</head>
<body>
<script>
Ext.application({
    name: 'Sencha',

    launch: function() {
        //The whole app UI lives in this tab panel
        Ext.Viewport.add({
            xtype: 'tabpanel',
            fullscreen: true,
            tabBarPosition: 'bottom',

            items: [
                // This is the home page, just some simple html
                {
                    title: 'Home',
                    iconCls: 'home',
                    cls: 'home',
                    html: [
                        '<img height=260 src="http://staging.sencha.com/img/sencha.png" />',
                        '<h1>Welcome to Sencha Touch</h1>',
                        "<p>Building the Getting Started app</p>",
                        '<h2>Sencha Touch (2.0.0)</h2>'
                    ].join("")
                },

                // This is the recent blogs page. It uses a tree store to load its data from blog.json
                {
                    xtype: 'nestedlist',
                    title: '赛事',
                    iconCls: 'star',
                    cls: 'blog',
                    //onItemDisclosure:true,
                    
                    store: 
					{
                        type:'tree',
                        defaultRootProperty: 'items',
	                    fields: 
                        [
							'starttime','host','visit','score','state','result'
						],
					

                        proxy: 
                        {
                            type: 'ajax',
                            url : 'betwinTest.php',
                            reader: 
                            {
                                type: 'json',
                            }
                        },

                    },
                    getItemTextTpl: function(node) 
                    {
                        return '<a>{starttime},{host},{visit},{score},{state},{result}</a>';
                    },
                    
                    detailCard:
                    {
                        xtype:'container',
                        //html:'<a>{starttime},{host},{visit},{score},{state},{result}</a>',
                    },
                   
                },

                // This is the contact page, which features a form and a button. The button submits the form
                {
                    xtype: 'formpanel',
                    title: 'Contact Us',
                    iconCls: 'user',
                    url: 'contact.php',
                    layout: 'vbox',

                    items: [
                        {
                            xtype: 'fieldset',
                            title: 'Contact Us',
                            instructions: 'Email address is optional',

                            items: [
                                {
                                    xtype: 'textfield',
                                    label: 'Name',
                                    name: 'name'
                                },
                                {
                                    xtype: 'emailfield',
                                    label: 'Email',
                                    name: 'email'
                                },
                                {
                                    xtype: 'textareafield',
                                    label: 'Message',
                                    name: 'message',
                                    height: 90
                                }
                            ]
                        },
                        {
                            xtype: 'button',
                            text: 'Send',
                            ui: 'confirm',

                            // The handler is called when the button is tapped
                            handler: function() {

                                // This looks up the items stack above, getting a reference to the first form it see
                                var form = this.up('formpanel');

                                // Sends an AJAX request with the form data to the url specified above (contact.php).
                                // The success callback is called if we get a non-error response from the server
                                form.submit({
                                    success: function() {
                                        // The callback function is run when the user taps the 'ok' button
                                        Ext.Msg.alert('Thank You', 'Your message has been received', function() {
                                            form.reset();
                                        });
                                    }
                                });
                            }
                        }
                    ]
                }
            ]
        });
    }
});
	

</script>


</div><!-- /page -->

</body>
</html>
